import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:lcapp/basic/user_info.dart';
import 'package:lcapp/config/const_config.dart';
import 'package:lcapp/page/home/home_share_page.dart';
import 'package:lcapp/widget/asr_app_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:lcapp/widget/lc_gesture_detector.dart';

class MinYaoQingFriendsPage extends StatefulWidget {
  const MinYaoQingFriendsPage({Key? key}) : super(key: key);

  @override
  _MinYaoQingFriendsPageState createState() => _MinYaoQingFriendsPageState();
}

class _MinYaoQingFriendsPageState extends State<MinYaoQingFriendsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AsrAppBar(
        titleText: '邀请好友',
        elevation: 0.0,
        backgroundColor: defaultBarColor,
        barColor: Colors.white,
      ),
      body: Container(
        color: Colors.amber,
        padding: EdgeInsets.zero,
        width: 1.sw,
        height: 1.sh,
        child: Stack(
          children: [
            Positioned(child: Image.asset('assets/min/yq_bg.png',fit: BoxFit.cover,),left: -20,right: -20,top: 0,bottom: 0,),
            Positioned(
                child: Container(
                  margin: EdgeInsets.only(top: 100.w),
                  width: 1.sw,
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Text('邀请好友注册得现金',style: TextStyle(
                        color: Colors.white,
                        fontSize: 50.sp,
                        fontWeight: FontWeight.w600
                      ),),
                      SizedBox(height: 100.w,),
                      Image.asset('assets/min/yq_wsxj.png',width: 500.w,),
                      Container(
                        margin: EdgeInsets.only(top: 100.w,bottom: 150.w),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            lcGestureDetector(
                              isLogin:true,
                              onTap: (){
                                SmartDialog.show(
                                  alignment: Alignment.bottomCenter,
                                  clickMaskDismiss: true,
                                  maskColor: Color.fromRGBO(0, 0, 0, 0.5), builder: (BuildContext context) {
                                    return HomeSharepage(
                                      contentType: 3,
                                      shareType: 1,
                                      webURL: '${BasVueurl}/#/invite',
                                    );
                                },
                                );
                              },
                              child: Container(
                                height: 90.w,
                                width: 295.w,
                                child: Stack(
                                  children: [
                                    Image.asset('assets/min/yz_hy.png',fit: BoxFit.cover,),
                                    Center(
                                      child: Text('邀请好友',style: TextStyle(
                                          color: Color(0xffFF4E3D),
                                          fontSize: 28.sp,
                                          fontWeight: FontWeight.w600
                                      ),),
                                    ),
                                  ],
                                ),
                              ),
                            ),
                            SizedBox(width: 20.w,),
                            lcGestureDetector(
                              isLogin:true,
                              onTap: (){
                                SmartDialog.show(
                                  alignment: Alignment.bottomCenter,
                                  clickMaskDismiss: true,
                                  maskColor: Color.fromRGBO(0, 0, 0, 0.5), builder: (BuildContext context) {
                                    return HomeSharepage(
                                      contentType: 4,
                                      shareType: 2,
                                      webURL: '${BasVueurl}/#/invite',
                                    );
                                },
                                );
                              },
                              child: Container(
                                height: 90.w,
                                width: 295.w,
                                child: Stack(
                                  children: [
                                    Image.asset('assets/min/yq_ewm.png',fit: BoxFit.cover,),
                                    Center(
                                      child: Text('邀请二维码',style: TextStyle(
                                          color: Colors.white,
                                          fontSize: 28.sp,
                                          fontWeight: FontWeight.w600
                                      ),),
                                    ),
                                  ],
                                ),
                              ),
                            )
                          ],
                        ),
                      ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                          Image.asset('assets/min/yq_share.png',height: 150.w,),
                          Container(
                            padding: EdgeInsets.only(bottom: 25.w),
                            child: Image.asset('assets/min/yq_jindu.png',height: 30.w,),
                          ),
                          Image.asset('assets/min/ya_reg.png',height: 150.w,),
                          Container(
                            padding: EdgeInsets.only(bottom: 25.w),
                            child: Image.asset('assets/min/yq_jindu.png',height: 30.w,),
                          ),
                          Image.asset('assets/min/ya_getxj.png',height: 150.w,),
                        ],
                      )
                    ],
                  ),
                )
            )
          ],
        ),
      ),
    );
  }
}
